<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>个人博客</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
            crossorigin="anonymous"></script>
    <link rel="stylesheet" type="text/css" href="style/style.css" />
    <style>
        #test span{
            font-size: 15px;
        }
    </style>
    <script src="../jquery.min.js"></script>
</head>
<body>
<div id="main">
    <div id="header">
        <div id="logo">
            <div id="logo_text">
                <h1><a href="index.html">发帖内容<span class="logo_colour"></span></a></h1>
                <h2>我的博客</h2>
            </div>
        </div>
        <div id="menubar">
            <ul id="menu">
                <li class="selected"><a href="index.html">首页</a></li>
                <li><a href="01home.php">后台</a></li>
                <li><a href="index.html">发布</a></li>
                <li><a href="../1login.html">退出</a></li>
                <li><a href="#">更多</a></li>
            </ul>
        </div>
    </div>
    <div id="content_header"></div>
        </div>
    <div id="site_content">
        <div class="sidebar">

            <h3>最近消息</h3>
            <h4>你好世界</h4>
            <h5>Java php python go c javascript vue layui jquery bootstrap</h5>
            <p><br />
                <a href="#">了解更多</a></p>
            <p></p>

            <h3>搜索</h3>
            <form method="post" action="#" id="search_form">
                <p>
                    <input class="search" type="text" name="search_field"/>
                    <input name="search" type="image" style="border: 0; margin: 0 0 -9px 5px;" src="style/search.png" alt="Search" title="Search" />
                </p>
            </form>
        </div>
        <div id="content">
            <div class="panel panel-default">
                <div class="panel-heading">
                    信息列表
                </div>
                <div class="panel-body">
                    <div id="test"></div>
                </div>
            </div>
    </div>
    <div id="content_footer"></div>
    <div id="footer"></div>
</div>

<script>
    $(document).ready(function() {
        $.ajax({
            url : "conn.php",
            dataType : "json",
            type : "post",
            async : false,
            success : function(data) {
                var html = "";
                for(var i=0;i<data.length;i++){
                    var ls = data[i];
                    html +="<br>";
                    html +="序号：<span>"+ls.ID+"</span>";
                    html +="<br>";
                    html +="用户：<span>"+ls.username+"</span>";
                    html +="<br>";
                    html +="评论：<span>"+ls.remark+"</span>";
                    html +="<br>";
                    html +="发布时间：<span>"+ls.time+"</span>";

                }
                $("#test").html(html);
            },
        })
    })
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
</body>
</html>